
// #ifndef VUE3
import Vue from 'vue'
import App from './App'
const prop=()=>{

	//let serviceUrl="http://127.0.0.1:5000";
	let serviceUrl="http://admin.heshihuan.cn";
	
	return {"serviceUrl":serviceUrl}
	

}  
const get = (url,obj)=>{
	//模拟异步请求数据
	return new Promise((resolve, reject) => {
		let u=uni.getStorageSync('userInfo');
		let token=""
		if(u!=undefined){
			token=uni.getStorageSync('userInfo').token;
		}
		
		// token="150_158_157_86_107_148_171_86_93_157_152_166_104_"
		uni.request({  
			url: url,  
			data: obj, 
			header:{
			 		'token':token,
			 		},
			success: (result) => {  
				resolve(result.data);  
			},  
			fail: (e) => {  
				reject(e);  
			}  
		})  
	})  
}
const alert = (message,obj)=>{
	//模拟异步请求数据
	return new Promise((resolve, reject) => {
		uni.showToast({
		          title: message,
		          icon: 'none',
		        });
	})  
}
const navigateTo = (url,obj)=>{
	//模拟异步请求数据
	return new Promise((resolve, reject) => {
		uni.navigateTo({
						  
				  url: url
				});
	})  
}


Vue.config.productionTip = false
Vue.prototype.$api = {get,prop,alert,navigateTo};
App.mpType = 'app'

const app = new Vue({
    ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import App from './App.vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif